/**
 * Copyright (c) 2006 RiseSoft Co.,Ltd  
 * $Header$
 */
package cn.newtest.bi.collection.model;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;

/**
 * 报表依赖
 *
 * @author <a href="mailto: chenjian@risesoft.net">陈健</a>
 * @version $Revision$
 * 
 */
@Entity
@org.hibernate.annotations.Entity(dynamicInsert=true,dynamicUpdate=true)
@Table(name="Rpt_Template_Dependence")
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class TemplateDependence implements Serializable {

	private static final long serialVersionUID = -8551110701059300093L;
	
	@Id
	@Column(name="TD_GUID",length=38)
	@GenericGenerator(name="TemplateDependence-assigned",strategy="assigned")
	private String guid;
	
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="Template_GUID",nullable=true)
	private Template template;
	
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="Dependence_Template_GUID",nullable=true)
	private Template dependence;
	
	@Basic
	private Double tabIndex;

	@Transient
	public String getDependence_guid() {
		return dependence.getGuid();
	}
	
	@Transient
	public String getDependence_name() {
		return dependence.getName();
	}
	
	@Transient
	public String getDependence_code() {
		return dependence.getCode();
	}
	
	@Transient
	public Double getDependence_tabIndex() {
		return tabIndex;
	}
	
	public String getGuid() {
		return guid;
	}

	public void setGuid(String guid) {
		this.guid = guid;
	}

	public Template getTemplate() {
		return template;
	}

	public void setTemplate(Template template) {
		this.template = template;
	}

	public Template getDependence() {
		return dependence;
	}

	public void setDependence(Template dependence) {
		this.dependence = dependence;
	}

	public Double getTabIndex() {
		return tabIndex;
	}

	public void setTabIndex(Double tabIndex) {
		this.tabIndex = tabIndex;
	}
}
